package com.zzz.park;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String parkState = scanner.next();

        String[] parking = parkState.split(",");

        int maxWidth = 0;

        int start = 0;
        int end = 0;
        int lastStop = 0;
        for(int i = 0; i<parking.length; i++) {
            if(parking[i].equals("1")){
                if(i>0 && parking[i-1].equals("0") && lastStop > 0) {

                    int newWidth = (i-lastStop+1) /2;

                    if(newWidth > maxWidth) {
                        maxWidth = newWidth;
                    }
                }

                if(lastStop == 0){
                    start = i+1;
                }

                lastStop = i + 1;

            }
        }

        end = lastStop;

        int startWidth = start - 1;
        int endWidth = parking.length - end;

        System.out.println(Math.max(maxWidth, Math.max(startWidth, endWidth)));

    }
}
